package com.silverbox.shopper.dubboApi.alipay;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.silverbox.shopper.dubboApi.alipay.dto.UndiscountWaimaiDTO;
import com.silverbox.shopper.entity.AlipayApplyAuthToken;
import com.silverbox.shopper.entity.AlipayTradeRecord;
import com.silverbox.shopper.entity.OrderThirdTradeRelated;
import com.silverbox.shopper.entity.PayModel;

public interface AlipayServiceApi {

	/**
	 * 查询店铺授权令牌
	 * 
	 * @param token
	 * @return
	 */
	List<AlipayApplyAuthToken> getAlipayApplyAuthToken(AlipayApplyAuthToken token);

	/**
	 * 计算不打折金额
	 * 
	 * @param storeId
	 * @param outSupportId
	 * @param waimai
	 * @param priceFlag
	 * @return
	 */
	Map<String, Object> getUnDiscountAmount(Integer storeId, Long outSupportId, UndiscountWaimaiDTO waimai,
			boolean priceFlag);

	/**
	 * 修改店铺授权令牌
	 * 
	 * @param token
	 */
	int updateAlipayApplyAuthToken(AlipayApplyAuthToken token);

	/**
	 * 保存交易记录
	 * 
	 * @param record
	 * @return
	 */
	int saveAlipayTradeRecord(AlipayTradeRecord record);

	/**
	 * 根据订单编号查询交易记录
	 * 
	 * @param orderNum
	 * @return
	 */
	AlipayTradeRecord findAlipayTradeRecordByOrderNum(String orderNum,String payOrderNum);

	/**
	 * 批量保存交易渠道
	 *
	 * @return
	 */
	void insertTradeFundChannelByBatch(String orderNum, String tradeNo, Integer storeId, Integer shopperId,
			String platform, Date date, String fundBillList);
	
	/**
	 * 获取支付方式的信息
	 * @return
	 */
	PayModel getPayCodeByPayModel(Integer payModel);

	/**
	 * 保存或修改订单与第三方支付关联记录
	 * @return
	 */
	int saveOrUpdateRecord(OrderThirdTradeRelated orderThirdTrade);

}
